﻿using System;
using System.ServiceModel;
using System.Windows.Forms;
using WcfEventWinFormsClient;

namespace Arete
{
    static class AppMain
    {
        internal static Form1 ClientForm { get; set; }
        internal static FormsEventServiceClient Proxy { get; set; }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            IMyEvents evnt = new MyFormsSubscriber();
            var evntCntx = new InstanceContext(evnt);

            Proxy = new FormsEventServiceClient(evntCntx);
            Proxy.SubscribeEvent();


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ClientForm = new Form1();
            Proxy.DoSomethingAndFireEvent();
            Application.Run(ClientForm);
        }
    }
}
